EasyPQC
EasyPQC (Or Easy Post Quantum Cryptography) is a C# class focused on more social aspects of cryptography (Such as secret passing and the like. This contains four parts you should be looking at;
and three functions
Same as the method above, but with support for cancellation using a CancellationToken.
csharp
using var cts = new CancellationTokenSource();
await FileUtils.WriteAllBytesAsync("output.dat", myData, progress => Console.WriteLine(progress), cts.Token);
Reads all bytes from the specified file asynchronously using a buffered approach.
csharp
byte[] data = await FileUtils.ReadAllBytesAsync("input.dat");
One of my hardest scripts, but this has key turning in it (Constnatly making an encryption key available to everyone that's part of the group)
First, the leader creates a Kyber public private key pair and the public key is shared
Everyone uses the public key to create a key encapsulation, this is our session key
We encrypt the session key using AES256GCM and give it to everyone
Everyone signs their key using Dilithium, then when a message is sent we always verify it
When a message is sent, we encrypt the message with the current version of the session key
A nonce is created/signed for every message (contains a counter, the username, previous session key and message hash)
Automatically we know the user is the user if the nonce is able to be both decrypted and read
The session key is evolved with SHAKE256
After an interval (could be time or amount of messages), we create a new kyber key, with dilithium used for authenticity (rotation)